<template>
  <view class="card first padding-top-30 padding-lr-30 padding-bottom-14">
    <order-info-item label="订单号" :value="orderInfo.orderNo" />
    <order-info-item label="下单时间" :value="orderInfo.createTime" />
    <order-info-item label="车费" :value="orderInfo.realPrice?'￥'+orderInfo.realPrice:'￥'+'0'">
      <view v-if="orderInfo.ioType&&(orderInfo.dispatchAmount||orderInfo.overstepAmount)&&!orderType">
        <text class="text-24 color-error">(包含</text>
        <text v-if="orderInfo.dispatchAmount" class="text-24 color-error">异地派遣费用￥{{ orderInfo.dispatchAmount }}、</text>
        <text v-if="orderInfo.overstepAmount" class="text-24 color-error">超里程费用￥{{ orderInfo.overstepAmount }}</text>
        <text class="text-24 color-error">)</text>
      </view>
    </order-info-item>

    <template v-if="!orderInfo.ioType && !orderType">
      <order-info-item label="优惠券" v-if="orderInfo.type != 8" :value="orderInfo.couponAmount ? '￥' + orderInfo.couponAmount : '未使用'" />
      <order-info-item v-if="orderInfo.status===3" label="违约金" :value="'￥'+(orderInfo.consumeAmount||0)" />
      <order-info-item label="实付金额" :value="'￥'+orderInfo.realPrice?orderInfo.realPrice:'暂无'" />
      <order-info-item v-if="orderInfo.status===3" label="退款金额" :value="'￥'+orderInfo.refundAmount" />
    </template>

    <order-info-item v-if="!orderType"  label="支付方式" :value="orderInfo.payWayLabel" />

    <template v-if="!orderInfo.vehicleId && !orderType">
      <order-info-item label="外调车辆费用" :value="orderInfo.outwardVehicleRealPrice ? '￥' + orderInfo.outwardVehicleRealPrice : '暂无'" />
      <order-info-item label="外调车辆支付方式" :value="orderInfo.payWayLabel" />
    </template>
	
	<span v-if="orderType">
		<order-info-item label="订单状态" :value="orderInfo.orderStatus" />
	</span>
	<span v-else>
		<order-info-item v-if="(orderInfo.ioType&&orderInfo.payWay != 3)||!orderInfo.ioType" label="支付状态" :value="orderInfo.payStatusLabel" />
	</span>

    <template v-if="!orderInfo.ioType">
      <order-info-item v-if="orderInfo.invoiceRecordStatusLabel" label="发票状态" :value="orderInfo.invoiceRecordStatusLabel" />
      <order-info-item label="客户留言" :value="orderInfo.message || '无'" />
    </template>
	<!-- 待对接口 -->
	<order-info-item v-if="orderType" label="加价金额" :value="orderInfo.totalAddPrice || '0'" />
    <order-info-item v-if="!orderInfo.driverType && orderInfo.vehicleId != '' && !orderType" label="司机补助" :value="orderInfo.driverSubsidyAmount || '0'" />
    <order-info-item v-if="orderInfo.driverType && !orderType" :label="orderInfo.driverType===1 ? '平台司机费用' : '外调司机费用'" :value="orderInfo.platformDriverFee ? `￥${orderInfo.platformDriverFee}` : '￥0'" />
    <order-info-item v-if="!orderType" label="订单备注" :value="orderInfo.remark || '无'" />
  </view>
</template>

<script>
import OrderInfoItem from '../order-info-item/order-info-item'
export default {
  name: 'OrderInfo',
  components: {
    OrderInfoItem
  },
  props: {
    orderInfo: {
      type: Object,
      default: () => {}
    },
	orderType: {
	  type: Number,
	  default: 0
	},
  }
}
</script>

<style scoped lang="scss">
@include setPadding(bottom,14);

.first{
  border-radius:0 0 14rpx 14rpx;
}
</style>
